20120326-0714-DWDT Minor code cleanup and refactoring