Code cleanup / AS3 compatibility