move all parsing to scanner