Optimized the reference application.