DRY up the server code using a table class