Make throwing exception optional