Clean up view code