refactor get parent method