Refactored code to reduce inline CSS