safer sharing of library by not using global