Refactor config classes