refactor read flat file rule from mongo