Cleaned code up more. Made view creation a method