Moved database to user local file
Refactoring of generator delay function