refact, move actions from global to Window, wiring event listening