Shared environment code.