some reorganization, hopefully javascript will talk to us now