Fix bug and removed request_context
Minor improvements: removed unnsecessary code