refactor, add config