slightly more intelligent autocompletion