Optimize init JS, less repetition

Less JS = better JS