minor refactor. event handling now encapsulated into view