js components object check refactored