refactoring specifications and classes