Wrapped WINDOW with WindowFactory as singleton, Fixed memory leaks.