Some refactoring + use the same custom field to store parent/child relation