Preserve type filters if else branch returns