global variables avoided