refactor spec.
refactor util.