refactor AnnReader and add test cases