Improve pages detector