Some code clean-up + several comments added.