Refactor for configure