refactored regions logic and markup (bug 934582)