Also moves the config loading to BEFORE the log configuration
Move parameter handling into its own function and better use the `.get()` function for dictionaries. Early return on the failed checks is more readable. The lambda function in the callback was long and hard to read so moved it out.