simplify default database set up
tidy up code