Add classes for exception handling + support optional parameters