refactor rdbms_writer