refactor config to have a nicer constructor