fix tests
refactoring attach detach holder + other fixes
update annotations for compiler