use configurator and refactoring