Code refactoring; fixed cascade delete in the DB script; moved all settings to config file.