Moved event target code to a helper function
Merge pull request #29 from tagawa/small-edits

Moved event target code to a helper function