move attr name to flexy class
move indexing logic out of stage
fix generics