Prepartion work for adding MOCs. In addition, some refactoring