refactor sgfparser