Unify presence and env API