Refactor SWF parser