refactoring
exception handling