refactor min js