some code cleanup on console logging