Added extractSource and configureSource function