refactored more of in_memory_spec.rb