Reorganize project listing code