cleaning up view logic