start getting rid of globals