updated example controller
Seperated view functionality to make it more SOLID