Refactor - seperated connection, data reader code and other logic into seperate classes