refactored schemas in database, fixes #32