Clean and fixing function