refactor: moved config logic to lib/utils/config