fixed specs; small refactoring;