Updates to roles select and code generation