extract nested objects
create entity from metadata instead of manually instantiating it.