Clean and optimize helper