Refactor logic that deals w/ init and env scripts