clean up lib/master.js