Refactoring code for optimized feed clean up process