cleans up torus translation code