refactoring in headless.lang

preparing for abstracting across Tortoise and Elephant