Refactored fetching routines and classes.