more refactoring / improvement for linked mode stuff