UI changes, javascript refactoring