Improve the logIt function