Separate javascript file.
Wrap Cell function and a little bit refactor
Fix error