Improve performance by removing redundant operations