Major code clean up...