get rid of some global stuff by making this a device, need this step for now, will improve further later (nw)