According to the logic work of Xmodule 
```javascript 
$(document).ready(function () {...});
```
not needed here. In this case, you can simplify the module structure.