Add some comments and a TODO
Put common string into short-named function
Fix a mistake in commented code
Remove some TODOs

I've got the needed table structure and my guesses were right.
Rename a function
Add index on status in fresh install
Update the update routine