Cleanup and refactoring

- put processing threads as seperate classes
- extracted the main method to a seperate class
- not done enough comments...