Cleaned up styles and refactored code