removed unused code and fixed style