[AM] Refactoring + xml structure changes