Refactors logic into Request class