removed unused method, reformat js code