rename file
further refactor and add database creation functionality