Added tests
Refactored edit and new forms