code cleanup and working level loader