refactored component class