Some refactos and polish code
Added connections among subentities