Base environment code