Performance Improvement - Loop elimination