Tidied up web services functions; now extra-DRY