Pass config through more functions and fix dialyzer errors

Remove the dynamic function call on line 22. Only modules that define callbacks should make dynamic calls.