code restructuration to have the JS in one file and not N times if we have N file fields.