Refactor log calls