refactoring sax parser