Factor out object creation for random object generation. Use it.