refactored and prettied up the view