updated nested model logic to make code more verbose