CFY-1840 refactoring after review.