refactoring and reorganising the code
extracted logic for creating schema version
insert the schema version when initializing