updated db model and reforrmated source