Moved code to process