comments and log messages improved