Don't add __main_template_block to the list of available blocks.
Don't use hardcoded block name.
Better check for $environment usage in method calls.