refactored gaml to use builder class