refactor main view to object literal notation