more refactoring error return values