Included max_iter value to be used by wait_for_state
Included more info logs
Cosmetic code changes