again refactored resolvinf of references