Split out console code