Modularized element.js
Comment out debug line
Clarify isValid a bit

Break up the conditions per line