[lib] Refactoring out Configuration logic into helper method