refactor table parser