PM.js refactor