more code generation details and copy from dictionary logic