Refactoring

  Reorganized modules to produce errors systematically and neatly.