Refactor pidfile variable