backported executor cleanup from develop