Move common code to utils and remove rbd execute commands