Refactor JS.
Modal tweaks.