UI cleaning code, added progress bar, memory optimizations