cleanup and compatibility with ST2 and ST3 on Windows and Mac