console: Rework code and console error