make region code more efficient