js links refactor