refactor the configure method