Clean up the database code
Add client class
Some code