js changed && refactored