fix getAllKeywords

renamed a few methods. moved some code around.