Refactoring, JS and CSS cleanup