more readable server code