Changed keyNumGenerator and nextAvailable to private, more cleaning