Refactors console_log