refactoring event handlers
view refactoring