[fix] Form is now working. Refactor toggle port code.