Separate code for inserting word-pairs and word-weights to db. Needs refactoring and modularization.