extract execute and make scheduler more generic for reuse