relocating functions into CralwerContext class