refactoring around playengine code
fix two regressions(#94, #95)