add| require js + refactor