removing double ref, and unnecessary arrows