Some console code cleanup