removed duplicated code

not sure why it was not this way from the start