removed code smell (duplicate code)