Compacted line of get the type from the Hash instance 

simple changes in `get_type_from_document`