Organize free pages functionality into dedicated files
Account for the total number of pages when inserting new pages