Moved aroun some code to make the actions "match"
Forgot to move type from attributes to top level