refactor unit pool