Reimplement/refactor connection/error handling and already existing database operations.