Optimize application by using compile-time indices