Refactor to make user environment-dependant so tests run under vagrant and production environments