Refactoring of spec