rename file for clarity
move logging to the end
more warning
Major reorganization / cleanup.