simplified logic for building nested properties