AVM1 refactoring