Would using SplObjectStore make this any simpler?