Code duplicate fix