Small speed up for keyboard. Added some extra queries