Use gproc to simplify some code