straight refactor to remove duplication in spec running code