Turn into window-level function, refactor
Update README