make server code lint-valid and tidy up a little bit