trying to resemble MVC pattern