Remove unused code

Closes gh-2244