refactored db classes and added license