refactored the main file into a class, added a postprocessing worker, generated some DB function stubs