cleaning up and fixing warnings