Refactor: Using proper MVC pattern