optimized webapp code