updated CodeDefinitionBuilder to allow chaining