MAINT: modified function only used in lib code to be private