Cleanup code based on static code analysis