refactor config in a common class