remove tmp stuff & clean up tg relations