Tortoise: code cleanups