Simplify shovel file and correct flake8 errors.