refactoring and add spec