[cleanup] Removed duplicated code