refactoring code related to css