[CAST-1773] Minor refactoring while review.