refactor spec helper