debugging functions for saving data to DB and refining data collection