improved from_dict for common objects + tests