simplify valid_extensions a little bit