Moved out the root page constraint and logic