refactored submit model