More refactoring
Added public methods for error handling