Much better API with more informative exceptions