Refactoring and writing specs.