Nice little cleanup of logging code