add conn.go, implement core features