Move key encoding to other place.