add loading bar, code cleanup