Refactoring + started core init function
Keygen