refactor parser and Q usage