New JS file for refactor