refactory v2 rspec codes