Clean up code. Separate out DataNodeRegistration class.