refactor leaf configuration