Code refacturing and css styling