specs and refactoring