optimized and cleaned