Seperated logic into views.