Refactored Database class, into multiple files.