[arctic] - Extract js file & refactor code.