lots of debug options, some code movement, etc