Use database instead of text file