Refactored generator and planExecutor (#5)