fixed bottleneck problem to become asynchronous publishing jobs and reformated all code to OOP