cleanup code for executor.