Small cleanups
remove unused code
remove redundant check
Simplify link loading
Small performance improvement