Moved cleanup logic
Minor formatting