some refactoring, added moment js