k2 terrain test and some refactors