Refactored auto complete a little bit.