play.js: code cleanup