Refactoring to clean up the dom and css.