tidy up server side