This whole scope could be a tiny static nested function and used in both static if branches