Reformatted and removed unused code