Refactored database doc