started to refactor to create private variables and methods
modularizing callbacks for network requests