base: refactor configuration handling