moved view specific code into corresponding classes