Refactored globals and added minification