add spec and refactoring