move env check from app.js to EnvironmentService