[minor] removed duplicated code