Refactor implementation to use lang.reflect.Routine instances