Add parent-child mode
Rename some function for more readable