misc cleaning up of code.