even more debug logging and a bit of code style revision