richpager refactoring
Fix supporting stdin