Updated Server D v1.2

Changed repeated code to a function call.