refactored: naming, function organization, added dummy window event functions