consolidate extension handling