kryo factory

This was related to #6

Sorry about removed spaces in commit but IntelliJ doesn't let me save without automatically remove them... I could have clean this with a simpler text editor but I think it's a good thing anyway :)