make replace faster