refactor - JS in modules