update to avoid global variables