updated minification logic and added UT