rebased on engity-plugin