polish up case handling