fix error with case parent and refactoring cases component