Refactored to silence static analyzer warnings
Removed obsolete code
Removed obsolete code