Possible bug here when someone pass null database in constructor. Consider adding else statement which will initialize database object and update data.