prepared code to run on server