refactored view with controller further