change back settings passing

and merge util.py
simplify get_database
merge for cleaner namespace