move functions to topology files