I want to learn best practices for structuring these kinds of small jquery plugin libraries. I believe I am using a bad design pattern and what I was going for is fewest line numbers and minimal code. Please advise on any better practices and any ways I can reduce the code down further. $(window).load(function(){ var body = document.body; if( body.style.animationName !== undefined ) { animationSupport = true; } if( animationSupport === false ) { for( var i = 0; i < domPrefixes.length; i++ ) { if( body.style[ domPrefixes[i] + 'AnimationName' ] !== undefined ) { prefix = domPrefixes[ i ]; animationString = prefix + 'Animation'; vendorPrefix = '-' + prefix.toLowerCase() + '-'; animationSupport = true; break; } } } }); Please see the full library here: https://github.com/jQueryKeyframes/jQuery.Keyframes/blob/master/jquery.keyframes.js