Refactor vagrant code