Separated database generation functionality into another file