Minor spelling fixes & refactoring

I felt like some of the boolean logic in `link.py` was a little cluttered so I tried to reorganize it a bit.