cleanup and RSpec fixes