Cleaned up util functions for searching nested dicts