Optimize the dimens, fix algorithms chosing, key generation.