refactoring for Lattice