Added CSS and refactored code