normal javaScript design pattern