config and refactor