css styling, javascript refactoring