Pulled lattice creation code into its own class.