refactor dotenv loading