More refactoring AMF
Refactoring some more