Slight refactor of generatePrivateKey...

to avoid having to give pass it a callback method