extract defaults and replacements from the env class
reduce repetition