refactor config system