Avoid repeated ref(), name variables better and let them be golfed
Improved golfing!

Namely..
eq '' => eq''
eq "" => eq""
eq $v => eq$v
Better alignment of non-golfed code but golfing to the same size :)

Includes golfing
eq ( => eq(