Javascript module snippets