refactor confg