Removed logic of reading input stream everytime