Move the auto completion logic in a dedicated object.
If self is set, then prefer self over this everywhere in the function.