remove unused functions and format output