Improved hierarchy of throwed exceptions and sanitized the client interface