Move event handlers to on() method