refactor rdbms-init and add tests