implement environment variable resolving