Adding InconsistentDataExpection and move some classes