Refactored the sdmo_ bits a little and put them in more appropriate spots.