Mark function as static
Remove dead variable