slight refactoring to prepare for handling of errors in children