refactoring, add spec