organizing server side code