refactoring + handleEvent interface