add nil logic to cleaning methods