Enh: refactored some code concerning activation key