small refactor in log command