code cleanup

i ran code analysis and did some clean up