Split up view/logic