cleaned up view code v2