added down migration rspec test
refactored code to make it cleaner and prettier