Moved view code into a new file.