Cleaned up logic and views.