Refactor code for easier readability.
Merge TFS Changeset 942