Shorten and optimize replace calls