#10 remove duplicate code