PM: rewrite js init for new test coverage