Added progress bar support. Code clean.