re-organise js folder
amd refactor