Remove code duplication in executors