fragment code generation