Better error handling using Exceptions