began refactoring to use exceptions