started to refactor select queries to be DRY and to build off of each other.  UNTESTED