clean up logging code