Improve completers generation

Should also add test case for this change in `PrefixCompleterTest`