updates request
refactoring and adding more tests