Quasi-periodic solutions of Hamiltonian systems