JS and UI rework