fixed correct component shutdown when setActive(false), refractoring, UnitTests