improve server side code with magic reflection