Added reloading of failed parts
Cleaned code