refactor goseg