Refactored views and solved some minor issues