imroved response. refactored a lot