Fix formatting; delete unused functions