Refactored and cleaned up test specs.