database spec refactored