refactor and simplify
a bit more refactoring
better handling of reactive changes to form attributes