Make completion function configurable