refactor js (again, again)