refactoring of JS structure, coffescript added
- coffescript refactoring