refactoring plugin code to follow best practices per http://docs.jquery.com/Plugins/Authoring