got metadata into logging. refactored env into a util class for later use