event handler init refactoring