An approach to homotopy classification of links