Merge pull request #521 from n-shiota/topodev

Refactor event handling