t7: refactor js