Unifying wrapping code for topologies