Refactored so IDs are now long, not int.