splitting js into different files, changing the interface slightly