Take SHADOW_RAM size into account.
small cleanup