refactoring and error handling