optconf: api refactoring #2