A method to construct Hamiltonian theories for systems of both ordinary and partial differential equations is presented. The knowledge of a Lagrangian is not at all necessary to achieve the result. The only ingredients required for the construction are one solution of the symmetry (perturbation) equation and one constant of motion of the original system. It turns out that the Poisson bracket structure for the dynamical variables is far from becoming uniquely determined by the differential equations of motion. Examples in classical mechanics as well as in field theory are presented.