Handle upgrade on DB version change.
Tidy up try/catch block.
Whitespace formatting & if/else brackets
little documentation.