fixed bug causing fitRegionFactor to not be used and refactoring