Refactoring configure method