improved logging system