fix - assignment to state member
fix - processing entity reference
add - processing for defining entities