var Pwx = {

    // Initialize app
    init: function() {
        // Enable zclip on the clippboard button
        if (this.hasFlash()) {
            $('.link-container button').zclip({
                path: '/js/ZeroClipboard.swf',
                copy: $('.link-container #link').text(),
                afterCopy: function() {}
            });
        } else {
            $('.link-container button').hide();
        }

        // Click event handler for password generation
        $('.password-length').click($.proxy(function(e) {
            e.stopPropagation();
            var length = parseInt($(e.target).text());
            $('#password').val(this.generatePassword(length));
        }, this));

        $('#expires').countdown($('#expires').data('expires'), this.countdownCallback);
    },

    // Callback function for the countdown timer
    countdownCallback: function(e) {
      $(this).html(e.strftime('' + '<span>%D</span> days ' + '<span>%H</span> hr ' + '<span>%M</span> min ' + '<span>%S</span> sec'));
    },

    // Detect if flash is enabled (http://stackoverflow.com/a/20095467)
    hasFlash: function() {
        var hasFlash = false;
        try {
            var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
            if (fo) {
                hasFlash = true;
            }
        } catch (e) {
            if (
                navigator.mimeTypes &&
                navigator.mimeTypes['application/x-shockwave-flash'] !== undefined &&
                navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin
            ) {
                hasFlash = true;
            }
        }

        return hasFlash;
    },

    // Generate random password string
    generatePassword: function(length) {
        var i, password,
            possibleChars = 'abcdefghijklmnopqrstuvwxyz';
        possibleChars += 'ABCDEFGHIJKLMNOPQSTUVWXYZ';
        possibleChars += '0123456789';
        possibleChars += '!@#$%^&*()_+-=[]{};"\'<>,./?\\';

        length = length || 24;

        password = '';
        for (i = 0; i < length; i++) {
            password += possibleChars.charAt(Math.floor(Math.random() * possibleChars.length));
        }

        return password;
    }
};

$(document).ready(function() {
    Pwx.init();
});

@@ -51,24 +51,126 @@
 ion() %7B%0A    
+    this.initClipboard();%0A        this.initCountdown();%0A        this.initPasswordGenerator();%0A    %7D,%0A%0A
     // Enabl
@@ -202,16 +202,48 @@
  button%0A
+    initClipboard: function() %7B%0A
         
@@ -545,29 +545,182 @@
 ;%0A        %7D%0A
-%0A
     
+%7D,%0A%0A    // Init countdown%0A    initCountdown: function() %7B%0A        $('#expires').countdown($('#expires').data('expires'), this.countdownCallback);%0A    %7D,%0A%0A
     // Click
@@ -758,16 +758,56 @@
 eration%0A
+    initPasswordGenerator: function() %7B%0A
         
@@ -1029,97 +1029,8 @@
 s));
-%0A%0A        $('#expires').countdown($('#expires').data('expires'), this.countdownCallback);
 %0A   

Split app initialization into several methods