Finished rewrite of the views code