code cleanup (getting env vars directly is not necessary)