refactor page/category
move _list_dir to utils