redone local config handling instead of just using credentials file