index: move sasl stuff to a dedicated function