Add common way of fetching and reading data which will be added to the current implementation in due course. Added unit tests for this new code.