server side code cleaning