moved view code into view folder