slight restructuring for views and their associated code