add minification and refactor