Small improvements to internal fn createNames