refactored code and added .active-capability