SWF: refactor