Small JS formatting and efficiency updates