worked on modualizing datbase end