refactoring family parsing