refactored: js