refactoring check validate region and another things