add db type and cleanup