[IMP] Improved code and done without session and improved test case.