Implement `createCodeTree`