Unit Database Tests incuded and Refactoring done