refactored submitComponent