Refactoring functions update and clean css