Added worker thread class, split GPU functions