Handle view replacement in no parent case
Remove unnecessary code