1. Add retry decorator 2. Naming some menbers to private
Rearrange function