Added Request class. Minor refactoring.