move processing to separate file