refactored for minification
better caching