fixed basic routing and restructured views with a view factory