minor refactor and a bugfix due to uninitialized param
unit tests for region class