AVM1 this and scope refactoring