Improved scene hierarchy implementation