Updated logic. Removed unneeded views.