modularising console logging