More cleanup and streamlining of the code....