Adjusted cleaning logic to be a lot simpler