refactor, spec incomplete