Refactored the view