Code refactor and css