refactored keyword lookup

using dictionary with common values for each lookup. this way shared results between keywords only have to be computed once.