Tidied code in server slightly