code cleanup thanks to code analysis