refactor unloader