refactored runtime