more refactoring to the new runtime