Remove duplicated block of code.