optimize log calls