changed how nested objects are handled and separated the normalization func