Clean up a bit topology related functions