refactor code in css