refactored submit component