cleanup keys length condition to be non-stupid