Avoid doing redundant memory operations