Refactoring and fix for princess select crash