Refactor, added rspec, better relationship logic