Simplifying onRequest method