Remove remove duplicate code