adopted inner class design pattern instead of jquery subclassing