Updated template and improved region handling.