extract configuration logic to different file