Small refactorings and more consistent code in behavior.clj.