updated extension logic