Restructure
Move env parsing to main