Move all kill tree logic to template