Simplify key code