refactor configure