making cleaning recursive to allow for nested dictionaries such as for the intercom case