Massive change, now everything seems to work with the database