cleaned up unused imports, whitespace line trailings. added logging for caught exceptions