Added some tests, broke down the view so that it's easier to test