Refactoring and specs