refactor nimoy.js