improved some exception handling and class names