nit: cache `keyboards[i]` to a local variable