instance main class once in a static method for file handling