Add logic for handling nested values and whole objects