Refactored db relation to improve preformance.
Update sql dump
Code cleanup