use one function to get configuration; added docstrings and doctest