Moved misc functions into driver classes and small cleanups(nw)