Cleaning up views and adding tests