Remove duplicated old code