turn firefox and chrome creation to functions