Refactoring. Moved the functions that were placed in the DatabaseUtils class.