helper procs and parser implementation stuff