Refactored spec/common.