Full refactoring of utilities.

Mainly config fallbacks.