medialinks refactoring