Principalization algorithm via class group structure