JS general corrections and style rework part 2