Code style changes, removed duplicate function getAncestorMapping