Using Hamiltonian models for the magnetic field lines, we propose a methodology to improve their confinement through the creation of transport barriers. A local modification of the safety profile creating a low-shear zone is shown to be sufficient to locally enhance drastically the regularity of the magnetic field lines without requesting a reversed shear. The optimal benefits of low-shear are obtained when the value q
0 of the safety profile in the low-shear zone is sufficiently far from the main resonance values m/n with low m and n, in the case of large enough values of those (m, n) mode amplitudes. A practical implementation in tokamak plasmas should involve electron cyclotron current drive to locally modify the magnetic shear.