improved the logging, other minor changes