refactored code for css