Remove unused method and format some code