Refactor JS for more projects