Refactoring and minor changes related to execution and disposal