cleaned up process spec and fixed memory leak