Refactor the code

Re-write Rspec test
Shorten routes