refactor code to follow MVC pattern