Refactors code required for setting up php-fpm