filter non-reference lines; reference instance construction code