Added comments to SQLiteHelperRefTables

and cleaned up a bit of code