Added flow model
Refactor ruby_to_mongo to to_mongo