Adding little test case for the culprit pageUrl!=
Refactoring SQL into the Model