[Concept] [PATCH v2 12/16] console: Move environment handling lower in the file