move initialisation into common.js
move initialisation calls to common and fix validation