Use std exceptions

Do minor code clean up

Change-Id: I6d585a19eb0f733429ae5a496edc2bb6ec0a5f29