Some code cleanup for PR # 44