level 2 fixes, refactoring