simplify getConfig to a single method with optional path