Remove redundant code when cleaning