Could we factor out the attachment pagespec code so that other plugins can use it?