clean up parts code, update rspec parts test