refactoring to use db rather than txt file
refactoring to use db rather than txt file