reorganized & abstracted main back up functions