refactoring and working on rpc get chunk call