Move logic to view from router