Refactoring and JS fix (new path)