Refactoring and Add spec