reducing dependancy on the window throughout the codebase