Simplifying keywords code and improving a bit its speed.

Running the benchmark script I could get around 3% improvement. Not big, but at least
the code was simplified and the speed didn't decrease.