terrain refactoring