Condensed the child creation code