byte fix
moved key handling into an extra class