remove connection usage and some workaround