Moved methods to script.
The eventhandler should make merging here unnecessary.