Moved the runnables to separate classes, fixed other bugs