Refactoring configs to classes