remove duplicate code
don't mess with input arguments