started to port some reference parsing routines