Code changed to use view
Code changed to use views