some optimizations; preparations for links