delete the repeated code