Started generalization of behavior code. Added more comments and update of design structure.