Refactored database
Added library