From last commit ai was prompted to remove code redundancy