remove legacy codes