Updated _getBuilderNames to use nested functions