simplify process id and lock file handling