cleaned up domain sample code