Refactoring

Changed threads in Atlas to deamons. Fixed mistakes.