Cleaned up database manager