Fix formatting and remove unused code