added optimizer to remove unused functions and vars