Remove unused variables and helper function
Merge pull request #2653 from tricknotes/remove-unused

Remove unused variables and helper function