We propose a new approach to the use of Jastrow ansatz in the calculation of electron correlations, based on a modification of the transcorrelated method of Boys and Handy [Proc. R. Soc. London, Ser. A 309, 209 (1969)]. In this new method, the original transcorrelated orbital equation is replaced with a general variational equation for the reference wave function, whereas the equation for the correlation factor remains the same. The method can be applied to a single determinant Jastrow ansatz as well as to a multideterminant one. For the single determinant ansatz, we obtain a Hartree-Fock type self-consistent equation for the optimization of orbitals, and for the multideterminant ansatz we have tested a CI type equation. We apply the new method in calculations of the C(2) molecule and compare the results with those of variational quantum Monte Carlo calculations.