Refact network part using template pattern.
some thing