Refactored environment and configuration file finder