Make various functions & messages generic so that they will work with any key size