optconf: api refactoring