refactor some of the format from discussion with steve, and add the MOE support