helper class used for KL methods and Laplacian method
refactor Laplaican method