Code cleanup

Changed to multiple files, variable cleanups, no major change to program
logic