refactored in_memory.rb to use build methods
refactored entities to use hash input