restructuring and adding db