Added small performance upgrade for replacement