added means to pass credentials
some other minor changes