Creates handleProcess function