Moved db logic stuff to DatabaseConnector class.