Adds naive page detection support.
Removes unused code.
Removes unused code.