improved subspec handling