Added more minifiable code, removed unneccessary functions