Add comments and optimize search of element to need replace