Code clean up and testExecute() modified