New method for the Hamiltonian formulation for lattice spin systems